package com.wzy.oa_sys.controller.robot;

import com.wzy.oa_sys.service.robot.UploadDocxService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wzy.oa_sys.mapper.user.UserMapper;
import com.wzy.oa_sys.model.pojo.attendance.OaTimeStandards;
import com.wzy.oa_sys.model.pojo.user.OaUser;
import com.wzy.oa_sys.model.request.robot.RobotReq;
import com.wzy.oa_sys.model.response.attendance.AttendanceResp;
import com.wzy.oa_sys.model.response.attendance.VacationResp;
import com.wzy.oa_sys.model.response.file.FileResp;
import com.wzy.oa_sys.model.response.notice.NoticeResp;
import com.wzy.oa_sys.model.response.schedule.BoardroomResp;
import com.wzy.oa_sys.model.response.schedule.ScheduleResp;
import com.wzy.oa_sys.model.response.schedule.UseBoardroomDataResp;
import com.wzy.oa_sys.model.response.task.TaskResp;
import com.wzy.oa_sys.model.response.user.DeptResp;
import com.wzy.oa_sys.model.response.user.PositionResp;
import com.wzy.oa_sys.model.response.user.UserResp;
import com.wzy.oa_sys.service.ChatAssistant;
import com.wzy.oa_sys.service.attendance.AttendanceService;
import com.wzy.oa_sys.service.attendance.TimeStandardService;
import com.wzy.oa_sys.service.attendance.VacationService;
import com.wzy.oa_sys.service.file.FileService;
import com.wzy.oa_sys.service.notice.NoticeService;
import com.wzy.oa_sys.service.robot.RobotService;
import com.wzy.oa_sys.service.schedule.BoardroomService;
import com.wzy.oa_sys.service.schedule.ScheduleService;
import com.wzy.oa_sys.service.schedule.UseBoardroomService;
import com.wzy.oa_sys.service.task.TaskService;
import com.wzy.oa_sys.service.user.DeptService;
import com.wzy.oa_sys.service.user.PositionService;
import com.wzy.oa_sys.service.user.UserService;
import com.wzy.oa_sys.util.JwtUtil;
import dev.langchain4j.data.segment.TextSegment;
import dev.langchain4j.store.embedding.inmemory.InMemoryEmbeddingStore;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import dev.langchain4j.data.document.Document;
import dev.langchain4j.data.document.loader.FileSystemDocumentLoader;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.FileOutputStream;
import java.util.List;
import dev.langchain4j.store.embedding.EmbeddingStoreIngestor;

@RestController
@RequestMapping("/uploadDocx")
public class UploadDocxController {


    @Resource
    private UploadDocxService uploadDocxService;

    @GetMapping("/uploadDocxForAI")
    public String uploadDocxForAI(HttpServletRequest request){
        String  answer= uploadDocxService.updateRobotDocxForAI(request);
        return answer;
    }
}
